﻿//-------------------------------------------------------------------------
///-----------------httpCurl-----------------------------------------------
///-----------------http相关---------------------------------------------
///-----------------2023/01/02---by mv------------------------------
//-------------------------------------------------------------------------
#pragma once

//-------------------------------------------------------------------------
#ifndef _CLASS_httpCurl_H
#define _CLASS_httpCurl_H

//--------------------------------------------------------------------------
#include "common/mvPubApi.h"

//-------------------------------------------------------------------------
namespace mv
{
	//----------------------------------------------------------------------------
	class HttpCurlMgr
	{
	public:
		//-------------------------------------------------
		/// 单例模式（Singleton)
		///  1.  _不能使用new创建对象，也不能直接定义类变量
		///  2.  _至少需要提供一个静态的方法，用于返回唯一的对象实例
		//-------------------------------------------------
		static HttpCurlMgr* getSingleton();
		static void destroyInstance();

		//-------------------------------------------------
	public:
		void setUploadPath(const std::string sPath, const std::string sIP, const int iPort);
		std::string httpPostFile(const std::string& filePath, const std::string& vehicleNo);
	private:
		//-------------------------------------------------
		HttpCurlMgr();
		HttpCurlMgr(const HttpCurlMgr&);
	private:
		//-------------------------------------------------
		std::string sChannelID = "";
		std::string m_sInterfacePath = "/platform/uploadImage";
		std::string m_sIP = "192.168.20.139";
		int m_iPort = 8081;
		static HttpCurlMgr* _HttpCurlMgr;//对外实例
		
		ThreadPool* m_threadPoor;				         //线程池
		//-------------------------------------------------
	};

	//----------------------------------------------
}

//---------------------------------------------------------------------------
#endif //!_CLASS_httpCurl_H
